package com.cyb.example.consumer;

import com.cyb.crpc.config.RpcConfig;
import com.cyb.crpc.proxy.ServiceProxyFactory;
import com.cyb.crpc.utils.ConfigUtils;
import com.cyb.example.common.model.User;
import com.cyb.example.common.service.UserService;

public class ExampleConsumerApplication {
    public static void main(String[] args) {
        // 需要获取具体的实现对象
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("cyb");
        // 远程调用
        User newUser = userService.getUserName(user);
        if (newUser != null) {
            System.out.println("用户名：" + newUser.getName());
        } else {
            System.out.println("用户 == null");
        }
        long number = userService.getNumber();
        System.out.println(number);
    }
}